package com.example.helloworld;

import java.util.HashSet;

public class HashSetTest {
    public static void main(String[] args) {
        HashSet<String> set = new HashSet<>();
        set.add("apple");
        set.add("banana");
        set.add("orange");
        set.add("apple");
        System.out.println(set);
        System.out.println(set.contains("apple"));
        set.remove("banana");
        System.out.println(set);
        System.out.println("-----");
        for (String fruit: set) {
            System.out.println(fruit);
        }
    }
}
